package com.kyzh.core.adapters

import android.graphics.Color
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.kyzh.core.R
import org.jetbrains.anko.textColor


//  带背景的
class BqSoildAdapter(layout: Int, beans: ArrayList<String>) : BaseQuickAdapter<String, BaseViewHolder>(layout, beans) {

    override fun convert(helper: BaseViewHolder, item: String) {
        helper.setText(R.id.bq1, item)
        helper.getView<TextView>(R.id.bq1).apply {


                when (helper.adapterPosition) {
                    0 -> {
                        textColor=Color.parseColor("#FFF87706")
                        background.setTint(Color.parseColor("#FFFFEDDE"))
                    }
                    1 -> {
                        textColor=Color.parseColor("#FFEBAE38")
                        background.setTint( Color.parseColor("#FFFFF4DE"))
                    }
                    else -> {
                        textColor=Color.parseColor("#FFFF5D5D")
                        background.setTint(  Color.parseColor("#FFFFECEC"))
                    }
                }
        }
    }
}